
********************************************************************************
****** The Effects of WWII on Economic and Health Outcomes across Europe *******
********************************************************************************
* Authors: Iris Kesternich, Bettina Siflinger, James P. Smith, Joachim Winter
* Review of Economics and Statistics, 2014
********************************************************************************
* DOFILE: FIGURES 4&5
********************************************************************************


clear
clear matrix
clear mata
set more off


*** define the path to the directory containing the data files here 
*** or leave "." if the do files are in the current directory 

global datapath "."

*** define the path to the directory to which figures are saved here 
*** or leave "." if they should be saved to the current directory 

global graphpath  "."



use "$datapath\final\WWII_final.dta", clear


********************************************************************************
*** Figure 4: dispossession of population in WWII
********************************************************************************

tab dispos 

gen dispos_39_47 = 0 if dispos ~= .
replace dispos_39_47 = 1 if dispos == 1 & sl_gl033_1 > 1938 & sl_gl033_1 <= 1947 & dispos ~= .

recode country   (11 = 1)(12 = 2)(16 = 3)(28 = 4)(19 = 5)(29 = 6)(23 = 7)(17 = 8)(14 = 9)(18 = 10), g(country_n)
recode country_n (15 = 11)(13 = 12)(20 = 13)


gen country2 = country_n + 0.2
gen country3 = country2 + 0.2
gen country4 = country3 + 0.2

gen dispos_native = 0 if dispos ~= .
replace dispos_native = 1 if dispos == 1 & nativeborn == 1

gen dispos_foreign = 0 if dispos ~= .
replace dispos_foreign = 1 if dispos == 1 & nativeborn == 0

gen dispos_39_47_native = 0 if dispos ~= .
replace dispos_39_47_native = 1 if dispos == 1 & nativeborn == 1 & sl_gl033_1 > 1938 & sl_gl033_1 <= 1947 

gen dispos_39_47_foreign = 0 if dispos ~= .
replace dispos_39_47_foreign = 1 if dispos == 1 & nativeborn == 0 & sl_gl033_1 > 1938 & sl_gl033_1 <= 1947 

egen mean_disp_nat = mean(dispos_native), by(country_n)
egen mean_disp_for = mean(dispos_foreign), by(country_n)
egen mean_disp_nat3947 = mean(dispos_39_47_native), by(country_n)
egen mean_disp_for3947 = mean(dispos_39_47_foreign), by(country_n)


twoway (bar mean_disp_nat country_n, barw(0.2))(bar mean_disp_for country2, barw(0.2)) ///
(bar mean_disp_nat3947 country3, barw(0.2))(bar mean_disp_for3947 country4, barw(0.2)) , ///
legend( pos(2) col(1) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "dispossessed, native born" 2 "dispossessed, foreign born" 3 "dispossessed 1939-47, native born" 4 "dispossessed 1939-47, foreign born")) ///
xlabel(1 "AUS" 2 "GER" 3 "ITA" 4 "CZE" 5 "GRE" 6 "POL" 7 "BEL" 8 "FRA" 9 "NED" 10 "DEN" 11 "ESP" 12 "SWE" 13 "SUI", angle(45)) ///
title(Dispossession) yscale(range(.00 .2)) ylabel(.00(.04)0.2) ytitle(% dispossession) xtitle(Country) xsize(8) ysize(5)
graph export "$graphpath\dispossession_3947_native_foreign.png", width(600)replace

drop country2-country4




********************************************************************************
*** Figure 5: Later life outcome differences between war and nonwar countries
			  * by period of birth
********************************************************************************

gen country_sep = 1 if war_countries == 0
replace country_sep = 2 if war_countries == 1 & (country == 14 | country == 16 | country == 17 | country == 19 | country == 23 | country == 28 | country == 29)
replace country_sep = 3 if war_countries == 1 & (country == 11 | country == 12)

gen periods_5 = .
replace periods_5 = 1 if yrbirth3 >= 1920 & yrbirth3 <= 1925 & yrbirth3 ~= .
replace periods_5 = 2 if yrbirth3 >= 1926 & yrbirth3 <= 1930 & yrbirth3 ~= .
replace periods_5 = 3 if yrbirth3 >= 1931 & yrbirth3 <= 1935 & yrbirth3 ~= .
replace periods_5 = 4 if yrbirth3 >= 1936 & yrbirth3 <= 1938 & yrbirth3 ~= .
replace periods_5 = 5 if yrbirth3 >= 1939 & yrbirth3 <= 1944 & yrbirth3 ~= .
replace periods_5 = 6 if yrbirth3 == 1945 & yrbirth3 <= 1947 & yrbirth3 ~= .
replace periods_5 = 7 if yrbirth3 >= 1948 & yrbirth3 <= 1952 & yrbirth3~= .
replace periods_5 = 8 if yrbirth3 >= 1953 & yrbirth3~= .

gen periods_5_2 = periods_5 + 0.2
gen periods_5_3 = periods_5_2 + 0.2
gen periods_5_4 = periods_5_3 + 0.2




*** SELF REPORTED HEALTH: differences to nonwar countries 

egen mean_bar_health1 = mean(health) if nativeborn == 1 & country_sep == 1, by(periods_5)
egen mean_bar_health2 = mean(health) if nativeborn == 1 & country_sep == 2, by(periods_5)
egen mean_bar_health3 = mean(health) if nativeborn == 1 & country_sep == 3, by(periods_5)

bysort periods_5: replace mean_bar_health1 = mean_bar_health1[_n-1] if mean_bar_health1[_n-1] ~= . & mean_bar_health1[_n] == .
bysort periods_5: gen diff_health1_health2 = mean_bar_health2 - mean_bar_health1 if mean_bar_health2 ~= . 
tabstat mean_bar_health1 mean_bar_health2 diff_health1_health2, by(periods_5)

bysort periods_5: gen diff_health1_health3 = mean_bar_health3 - mean_bar_health1 if mean_bar_health3 ~= . 
tabstat mean_bar_health1 mean_bar_health3 diff_health1_health3, by(periods_5)


twoway (bar diff_health1_health2 periods_5, barw(0.15)) (bar diff_health1_health3 periods_5_2, barw(0.15)) if periods_5 >= 3 & periods_5 <= 7, ///
title(Self-reported health: Differences to non-war countries) yscale(range(.2 (.2) -.6)) ylabel(.2 (.2) -.6) yline(0) ytitle(differences in SRH) ///
xtitle(Year of birth) legend( pos(2) col(2) ring(0) symxsize(8) size(small) margin(tiny) keygap(1)  order(1 "other war countries" 2 "Germany/Austria")) ///
xlabel(3 "1931-35" 4 "1936-38" 5 "1939-44" 6 "1945-47" 7 "1948-52", angle(45)) note("note: self-reported health ranges from 1 to 5 with 5 excellent health")

graph export "$graphpath\health_diff_nonwar_alloth.png", replace




*** SCHOOLING: differences to nonwar countries 

egen mean_bar_school1 = mean(schooling) if nativeborn == 1 & country_sep == 1, by(periods_5)
egen mean_bar_school2 = mean(schooling) if nativeborn == 1 & country_sep == 2, by(periods_5)
egen mean_bar_school3 = mean(schooling) if nativeborn == 1 & country_sep == 3, by(periods_5)

bysort periods_5: replace mean_bar_school1 = mean_bar_school1[_n-1] if mean_bar_school1[_n-1] ~= . & mean_bar_school1[_n] == .
bysort periods_5: gen diff_school1_school2 = mean_bar_school2 - mean_bar_school1 if mean_bar_school2 ~= . 
tabstat mean_bar_school1 mean_bar_school2 diff_school1_school2, by(periods_5)

bysort periods_5: gen diff_school1_school3 = mean_bar_school3 - mean_bar_school1 if mean_bar_school3 ~= . 
tabstat mean_bar_school1 mean_bar_school3 diff_school1_school3, by(periods_5)


twoway (bar diff_school1_school2 periods_5, barw(0.15)) (bar diff_school1_school3 periods_5_2, barw(0.15)) if periods_5 >= 3 & periods_5 <= 7, ///
title(Schooling: Differences to non-war countries) yscale(range(2 (.5) -1.5)) ylabel(2 (.5) -1.5) yline(0) ytitle(differences in years of schooling) ///
xtitle(Year of birth) legend( pos(2) col(2) ring(0) symxsize(8) size(small) margin(tiny) keygap(1) order(1 "other war countries" 2 "Germany/Austria"))  ///
xlabel(3 "1931-35" 4 "1936-38" 5 "1939-44" 6 "1945-47" 7 "1948-52", angle(45)) note("note: years of schooling range from 0 to 25") 

graph export "$graphpath\schooling_diff_nonwar_alloth.png", replace




*** DEPRESSION: differences to nonwar countries

egen mean_bar_dep1 = mean(depress) if nativeborn == 1 & country_sep == 1, by(periods_5)
egen mean_bar_dep2 = mean(depress) if nativeborn == 1 & country_sep == 2, by(periods_5)
egen mean_bar_dep3 = mean(depress) if nativeborn == 1 & country_sep == 3, by(periods_5)

bysort periods_5: replace mean_bar_dep1 = mean_bar_dep1[_n-1] if mean_bar_dep1[_n-1] ~= . & mean_bar_dep1[_n] == .
bysort periods_5: gen diff_dep1_dep2 = mean_bar_dep2 - mean_bar_dep1 if mean_bar_dep2 ~= . 
tabstat mean_bar_dep1 mean_bar_dep2 diff_dep1_dep2, by(periods_5)

bysort periods_5: gen diff_dep1_dep3 = mean_bar_dep3 - mean_bar_dep1 if mean_bar_dep3 ~= . 
tabstat mean_bar_dep1 mean_bar_dep3 diff_dep1_dep3, by(periods_5)


twoway (bar diff_dep1_dep2 periods_5, barw(0.15)) (bar diff_dep1_dep3 periods_5_2, barw(0.15)) if periods_5 >= 3 & periods_5 <= 7, ///
title(Depression: Differences to non-war countries) yscale(range(.2 (.05) -.1)) ylabel(.2 (.05) -.1) yline(0) ytitle(differences in depression) ///
xtitle(Year of birth) legend(pos(2) col(2) ring(0) symxsize(8) size(small) margin(tiny) keygap(1)order(1 "other war countries" 2 "Germany/Austria")) ///
xlabel(3 "1931-35" 4 "1936-38" 5 "1939-44" 6 "1945-47" 7 "1948-52", angle(45)) note("note: depression ranges from 0 to 1 with 1 depression") 

graph export "$graphpath\depression_diff_nonwar_alloth.png", replace



